<template>
  <div class="page">
    <van-cell-group>
      <van-cell title="消息内容" :value="detail.content"/>
      <van-cell title="消息类型" :value="do_Type_Arr[detail.messageType]"/>
      <van-cell title="接收者" :value="detail.receiver"/>
      <van-cell title="发送者" :value="detail.sender"/>
    </van-cell-group>
    <!-- <van-cell-group>
      <van-cell title="收件人" value="王小二"/>
      <van-cell title="联系电话" value="13344556677"/>
      <van-cell title="地址" value="打发斯蒂芬等方面"/>
    </van-cell-group>
    <van-panel title="￥12.6" desc="数量:X1    时间:2019/02/22 12:12:12" status="已发货">
      <goods :item="item"></goods>
      <div slot="footer">
        <van-button size="small" type="danger">我要退款</van-button>
      </div>
    </van-panel>
    <van-cell-group>
      <van-cell title="快递公司" value="韵达"/>
      <van-cell title="快递单号" value="13344556677"/>
    </van-cell-group>-->
  </div>
</template>

<script>
import Goods from '@/components/Goods.vue'
import { updateReadStatus } from '@/api'
import mixin from '@/mixin'

export default {
  name: 'message-detail',
  mixins: [mixin],
  components: {
    Goods
  },
  data() {
    return {
      id: '',
      dd : '',
      item: {},
      detail:{},
      do_Type_Arr:[
        "推广员申请",
        "推广员申请驳回",
        "推广员申请审核通过",
        "推广的商品有购买意向提交",
        "推广的商品已经退款",
        "用户购买商品成功",
        "用户退款成功",
        "用户团购成功",
        "用户团购失败"
      ],
      item2: {
        title: '跟老王学英语',
        price: 0.01,
        oPrice: 200.00,
        desc: '王小二学英语是给小孩子的英语启蒙王小二学英语是给小孩子的英语启蒙王小二学英语是给小孩子的英语启蒙王小二学英语是给小孩子的英语启蒙',
        tag: '限时团购',
        img: 'https://edu-image.nosdn.127.net/07e3b8f9-5721-47bb-a710-ab8cce9cab9e.jpg'
      }
    }
  },
  created() {
    this.getData()
  },
  methods: {
    // getData() {
    //   messageDetail(this.id).then(res => {
    //     this.item = res
    //   }).catch(res => {
    //     this.item = res.data
    //   })
    // }
    getData() {
      console.log(this.$router.history.current.query.detail)
      console.log(this.$router.history.current.query.detail.messageID)
      this.detail = this.$router.history.current.query.detail;
      updateReadStatus(this.$router.history.current.query.detail.messageID).then(res => {

      })
    }
  }
}
</script>
<style scoped lang="stylus" rel="stylesheet/stylus">
@import '../style/mixin'
.van-panel
  margin $part-width 0
  .van-hairline--top
    text-align right
    &::after
      border-top-width: 0
</style>
